﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace AspDemo.Models
{
    public class Record
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long Id { get; set; }

        [ForeignKey("FK_User")]
        public string UserId { get; set; }
        public User User { get; set; }

        public DateTime Time { get; set; }
        public int HeartRate { get; set; }
        public float Temprature { get; set; }
        public int BloodPressureHigh { get; set; }
        public int BloodPressureLow { get; set; }
        public float BloodOxygenSaturation { get; set; }

        [NotMapped]
        public string BloodPressure => $"{BloodPressureHigh}/{BloodPressureLow}mmHg";
    }
}
